local shexve = fk.CreateSkill {
    name = "sy__shexve",
}

Fk:loadTranslationTable{
    ["sy__shexve"] = "设学",
    ["#sy__shexve_ask"] = "你可以将你展示的牌当【 %arg 】使用" ,
    [":sy__shexve"] = "出牌阶段限两次，你可以依次展示一名角色与你的一张手牌，然后若前者为非装备牌，你可以将后者当之使用(无次数限制)；否则你重铸这两张牌。",
}

shexve:addEffect("active", {
  anim_type = "offensive",
  card_num = 0,
  target_num = 1,
  prompt = "依次展示一名角色与你的一张手牌",
  can_use = function(self, player)
    return player:usedSkillTimes(shexve.name, Player.HistoryPhase) < 2 and #player:getCardIds("he")~=0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0 and not #to_select:getCardIds("he")~=0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local card1 = room:askToChooseCards(player, {
      target = target,
      min = 1,
      max = 1,
      flag = "he",
      skill_name = shexve.name
    })
    room:showCards(card1)
    player.room:delay(300)
    local card2 = room:askToChooseCards(player, {
      target = player,
      min = 1,
      max = 1,
      flag = "he",
      skill_name = shexve.name
    })
    room:showCards(card2)
    if Fk:getCardById(card1[1]).type ~= Card.TypeEquip then
        room:askToUseVirtualCard(player, {
        name = Fk:getCardById(card1[1]).name,
        skill_name = shexve.name,
        prompt = "#sy__shexve_ask:::"..Fk:getCardById(card1[1]).name,
        cancelable = true,
        extra_data = {
            bypass_times = true,
            extraUse = true,
        },
        subcards = card2
        })
    else
        room:recastCard(card1, player, shexve.name)
        room:recastCard(card2, player, shexve.name)
    end
  end,
})

return shexve